import request from '@/utils/request'

// 查询车辆信息列表
export function listVehicle(query) {
  return request({
    url: '/system/info/list',
    method: 'get',
    params: query
  })
}

// 查询车辆信息详细
export function getVehicle(carId) {
  return request({
    url: '/system/info/' + carId,
    method: 'get'
  })
}

// 新增车辆信息
export function addVehicle(data) {
  return request({
    url: '/system/info',
    method: 'post',
    data: data
  })
}

// 修改车辆信息
export function updateVehicle(data) {
  return request({
    url: '/system/info',
    method: 'put',
    data: data
  })
}

// 删除车辆信息
export function delVehicle(carId) {
  return request({
    url: '/system/info/' + carId,
    method: 'delete'
  })
}

// 修改车辆状态
export function changeStatus(carId, status) {
  const data = {
    carId,
    status
  }
  return request({
    url: '/system/info/changeStatus',
    method: 'put',
    data: data
  })
}

// 查询车辆黑名单列表
export function listBlacklist(query) {
  return request({
    url: '/system/blacklist/list',
    method: 'get',
    params: query
  })
}

// 查询车辆黑名单详细
export function getBlacklist(blacklistId) {
  return request({
    url: '/system/blacklist/' + blacklistId,
    method: 'get'
  })
}

// 新增车辆黑名单
export function addBlacklist(data) {
  return request({
    url: '/system/blacklist',
    method: 'post',
    data: data
  })
}

// 修改车辆黑名单
export function updateBlacklist(data) {
  return request({
    url: '/system/blacklist',
    method: 'put',
    data: data
  })
}

// 删除车辆黑名单
export function delBlacklist(blacklistId) {
  return request({
    url: '/system/blacklist/' + blacklistId,
    method: 'delete'
  })
} 